fn main() {
    use std::path::{Path, PathBuf};
    let proto = PathBuf::from("proto/tunnel_service.proto");
    let proto_path: &Path = proto.as_ref();
    let proto_dir = proto_path
        .parent()
        .expect("proto file should reside in a directory");
    tonic_build::configure()
        .protoc_arg("--experimental_allow_proto3_optional")
        .build_client(true)
        .build_server(true)
        // .format(false)
        .type_attribute(
            ".",
            "#[derive(serde_derive::Serialize, serde_derive::Deserialize)]",
        )
        .compile(&vec![proto_path], &vec![proto_dir])
        .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));

    // tonic_build::compile_protos("proto/tunnel_service.proto")
    //   .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
}
